# Contributor: Nathan Johnson <nathan@nathanjohnson.info>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-couchbase
_extname=couchbase
pkgver=4.2.1
pkgrel=0
pkgdesc="PHP 8.2 extension for Couchbase - PECL"
url="https://pecl.php.net/package/couchbase"
arch="all !riscv64 !ppc64le !s390x" # ftbfs
license="Apache-2.0"
_phpv=82
_php=php$_phpv
depends="$_php-pecl-igbinary"
makedepends="$_php-dev openssl-dev>3 linux-headers cmake"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	# no tests shipped via PECL
	$_php -d extension="$builddir"/modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	local _confdir="$pkgdir"/etc/$_php/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
92ab3170cb231a4c6663daf15d8749386a84e3fa31fb19b3bda39dfa28eaf50365df9c2eab229b69c630b511af8015598e4babea79d70ba4f9c721821727eb03  php-pecl-couchbase-4.2.1.tgz
"
